<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>IECO 登录</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="${path}/assets/hplus/favicon.ico">
    <link href="${path}/assets/hplus/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${path}/assets/hplus/css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="${path}/assets/hplus/css/animate.css" rel="stylesheet">
    <link href="${path}/assets/hplus/css/style.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
    <%@include file="/WEB-INF/common/hplus-css.jsp"%>
    <%@include file="/WEB-INF/common/hplus-js.jsp"%>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
                <h1 class="logo-name" style="text-align: center;color: #52bd91;font-size: 130px">IECO</h1>

            <h3 >欢迎使用 IECO环保</h3>


            <form class="m-t" id="login" role="form" action="${path}/user/login" method="post">
                <div class="form-group">
                    <input type="email" class="form-control" placeholder="用户名" name="account" required="true">
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" placeholder="密码" name="password" required="true">
                </div>
                <div class="form-group">
                    <div class="col-sm-8">
                        <input type="text" class="form-control"   placeholder="输入验证码" name="imgCode" required="true">
                    </div>
                    <div class="col-sm-2">
                        <img src="${path}/checkcode" style="width: 90px;height: 34px" id="code"  onclick="code()">
                    </div>
                    </div>
                <br>
                <br>
                <br>
                <button type="button" onclick="login()" class="btn btn-primary block full-width m-b">登 录</button>

                <p class="text-muted text-center"> <a href="#"><small>忘记密码了？</small></a> | <a href="#">注册一个新账号</a>
                </p>

            </form>
        </div>
    </div>

    <!-- 全局js -->
    <script src="${path}/assets/hplus/js/bootstrap.min.js?v=3.3.6"></script>
    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
    <!--统计代码，可删除-->
<script type="text/javascript">

    document.onkeydown = function (event) {
        var e = event || window.event;
        if (e && e.keyCode == 13) { //回车键的键值为13
            login(); //调用的登录事件
        }
    };


    function login() {
        $("#login").ajaxSubmit({
            url:'${path}/user/login',
            type:'post',
            dateType:'json',
            success:function (json) {
                json = eval('(' + json + ')');
                var code = json.code;
                var msg = json.msg;
                if (code==0){
                    window.location.href='${path}/user/manage';
                } else{
                    layer.msg(msg,{icon:5})

                }

            },
            error:function () {

            }
        });


    }

    $("#code").click(function () {
        $("#code").attr("src","${path}/checkcode")
    })



</script>
</body>
</html>
